var http = require('http')
var fs = require('fs')
var template = require('art-template')
//G:\HBuilderX\Node.js\node_modules\_art-template@4.13.2@art-template\lib\compile\es-tokenizer.js
var Resource = 'G:/HBuilderX/node_demo/resource/'

var server = http.createServer((req,res)=>{
    var url = req.url
    fs.readFile('html/01.template.html',(err,data)=>{
        if(err){
            return res.end('404 Not Found.')
        } else{
            res.setHeader('Content-Type','text/html;charset=utf-8')
            var htmlStr = template.render(data.toString(), {
                title: "my title"
            })
            res.end(htmlStr)
        }
    })
}).listen(8000)